<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: WiseRoute Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00227.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">WiseRoute Class Reference<div class="ingroups"><a class="el" href="a00507.html">netwLayer - network layer modules</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="WiseRoute" --><!-- doxytag: inherits="BaseNetwLayer" -->
<p>Wiseroute is a simple loop-free routing algorithm that builds a routing tree from a central network point. It is especially useful for wireless sensor networks and convergecast traffic, hence its name (Wireless Sensors Routing). The sink (the device at the center of the network) broadcasts a route building message. Each network node that receives it selects the sink as parent in the routing tree, and rebroadcasts the route building message. This procedure maximizes the probability that all network nodes can join the network, and avoids loops.  
 <a href="a00227.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00454_source.html">WiseRoute.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for WiseRoute:</div>
<div class="dyncontent">
<div class="center"><img src="a01072.png" border="0" usemap="#WiseRoute_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for WiseRoute:</div>
<div class="dyncontent">
<div class="center"><img src="a01073.png" border="0" usemap="#WiseRoute_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a01074.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00219.html">tRouteTableEntry</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ade7fd8114864ff11327435c57cab0e53"></a><!-- doxytag: member="WiseRoute::initialize" ref="ade7fd8114864ff11327435c57cab0e53" args="(int)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#ade7fd8114864ff11327435c57cab0e53">initialize</a> (int)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization of the module and some variables. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac82ec530969665b6848ef32e0a4816d7"></a><!-- doxytag: member="WiseRoute::finish" ref="ac82ec530969665b6848ef32e0a4816d7" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#ac82ec530969665b6848ef32e0a4816d7">finish</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the simulation has finished. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><b>messagesTypes</b> { <b>UNKNOWN</b> = 0, 
<b>DATA</b>, 
<b>ROUTE_FLOOD</b>, 
<b>SEND_ROUTE_FLOOD_TIMER</b>
 }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><b>floodTypes</b> { <b>NOTAFLOOD</b>, 
<b>FORWARD</b>, 
<b>FORME</b>, 
<b>DUPLICATE</b>
 }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae2042a6b1eee9f32d9fd0a95ec514b9b"></a><!-- doxytag: member="WiseRoute::floodTypes" ref="ae2042a6b1eee9f32d9fd0a95ec514b9b" args="" -->
typedef enum WiseRoute::floodTypes&#160;</td><td class="memItemRight" valign="bottom"><b>floodTypes</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa233ffcd07346b9a01daacdfc4f42d85"></a><!-- doxytag: member="WiseRoute::tRouteTableEntry" ref="aa233ffcd07346b9a01daacdfc4f42d85" args="" -->
typedef struct <br class="typebreak"/>
<a class="el" href="a00219.html">WiseRoute::tRouteTableEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><b>tRouteTableEntry</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8acf27ff5cfd449c445d00a497b99a84"></a><!-- doxytag: member="WiseRoute::tRouteTable" ref="a8acf27ff5cfd449c445d00a497b99a84" args="" -->
typedef std::map<br class="typebreak"/>
&lt; <a class="el" href="a00117.html#ad85cd9e8d9e7e9cd5d02dd740c4a12a4">LAddress::L3Type</a>, <br class="typebreak"/>
<a class="el" href="a00219.html">tRouteTableEntry</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>tRouteTable</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a965fc5f787ec273d081b3c0ec565ef58"></a><!-- doxytag: member="WiseRoute::tFloodTable" ref="a965fc5f787ec273d081b3c0ec565ef58" args="" -->
typedef std::multimap<br class="typebreak"/>
&lt; tRouteTable::key_type, <br class="typebreak"/>
unsigned long &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>tFloodTable</b></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Handle Messages</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Functions to redefine by the programmer</p>
<p>These are the functions provided to add own functionality to your modules. These functions are called whenever a self message or a data message from the upper or lower layer arrives respectively. </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aca0392ef347f060c9950238620245357"></a><!-- doxytag: member="WiseRoute::handleUpperMsg" ref="aca0392ef347f060c9950238620245357" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#aca0392ef347f060c9950238620245357">handleUpperMsg</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle messages from upper layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a30099bfda16298ba45f76f4ba2fb0985"></a><!-- doxytag: member="WiseRoute::handleLowerMsg" ref="a30099bfda16298ba45f76f4ba2fb0985" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a30099bfda16298ba45f76f4ba2fb0985">handleLowerMsg</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle messages from lower layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4f0df1761deb1e98784b416ea17fc1e7"></a><!-- doxytag: member="WiseRoute::handleSelfMsg" ref="a4f0df1761deb1e98784b416ea17fc1e7" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a4f0df1761deb1e98784b416ea17fc1e7">handleSelfMsg</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle self messages. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a03bea5d2e67da93c2abb61c2a54f109e"></a><!-- doxytag: member="WiseRoute::handleLowerControl" ref="a03bea5d2e67da93c2abb61c2a54f109e" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a03bea5d2e67da93c2abb61c2a54f109e">handleLowerControl</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle control messages from lower layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a9c57e8afd945eeb5f5b2ca817ad7392d">updateRouteTable</a> (const tRouteTable::key_type &amp;origin, const <a class="el" href="a00117.html#ad85cd9e8d9e7e9cd5d02dd740c4a12a4">LAddress::L3Type</a> &amp;lastHop, double rssi, double ber)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Update routing table.  <a href="#a9c57e8afd945eeb5f5b2ca817ad7392d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a679068365891c8fd94c37fd43976c0fd"></a><!-- doxytag: member="WiseRoute::decapsMsg" ref="a679068365891c8fd94c37fd43976c0fd" args="(WiseRoutePkt *msg)" -->
cMessage *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a679068365891c8fd94c37fd43976c0fd">decapsMsg</a> (WiseRoutePkt *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Decapsulate a message. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0003b4b04a19304216dea8d0a16fa839"></a><!-- doxytag: member="WiseRoute::updateFloodTable" ref="a0003b4b04a19304216dea8d0a16fa839" args="(bool isFlood, const tFloodTable::key_type &amp;srcAddr, const tFloodTable::key_type &amp;destAddr, unsigned long seqNum)" -->
floodTypes&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a0003b4b04a19304216dea8d0a16fa839">updateFloodTable</a> (bool isFlood, const tFloodTable::key_type &amp;srcAddr, const tFloodTable::key_type &amp;destAddr, unsigned long seqNum)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">update flood table. returns detected flood type (general or unicast flood to forward, duplicate flood to delete, unicast flood to me <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2787f895fa0f74d4c51b084dae927e74"></a><!-- doxytag: member="WiseRoute::getRoute" ref="a2787f895fa0f74d4c51b084dae927e74" args="(const tFloodTable::key_type &amp;destAddr, bool iAmOrigin=false) const " -->
tFloodTable::key_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a2787f895fa0f74d4c51b084dae927e74">getRoute</a> (const tFloodTable::key_type &amp;destAddr, bool iAmOrigin=false) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">find a route to destination address. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af500d987d4aa51e6f49824fbd3c438ba"></a><!-- doxytag: member="WiseRoute::routeTable" ref="af500d987d4aa51e6f49824fbd3c438ba" args="" -->
tRouteTable&#160;</td><td class="memItemRight" valign="bottom"><b>routeTable</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3f72d7988caeaa3ea64a79e724136ad5"></a><!-- doxytag: member="WiseRoute::floodTable" ref="a3f72d7988caeaa3ea64a79e724136ad5" args="" -->
tFloodTable&#160;</td><td class="memItemRight" valign="bottom"><b>floodTable</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a85496f386487b74241f1f49dc2382018"></a><!-- doxytag: member="WiseRoute::headerLength" ref="a85496f386487b74241f1f49dc2382018" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a85496f386487b74241f1f49dc2382018">headerLength</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Length of the NetwPkt header Read from omnetpp.ini. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7133c22ad06dc95ee4c0c3cb28128d47"></a><!-- doxytag: member="WiseRoute::macaddress" ref="a7133c22ad06dc95ee4c0c3cb28128d47" args="" -->
<a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a7133c22ad06dc95ee4c0c3cb28128d47">macaddress</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">cached variable of my network address <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a409930b44fc240f9e3edd108d6f9027a"></a><!-- doxytag: member="WiseRoute::sinkAddress" ref="a409930b44fc240f9e3edd108d6f9027a" args="" -->
<a class="el" href="a00117.html#ad85cd9e8d9e7e9cd5d02dd740c4a12a4">LAddress::L3Type</a>&#160;</td><td class="memItemRight" valign="bottom"><b>sinkAddress</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2a97e5b977b19cdda28811cfbd382c04"></a><!-- doxytag: member="WiseRoute::useSimTracer" ref="a2a97e5b977b19cdda28811cfbd382c04" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>useSimTracer</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a54b8e7bd6fc7ac3dcb1712bcd242d73d"></a><!-- doxytag: member="WiseRoute::rssiThreshold" ref="a54b8e7bd6fc7ac3dcb1712bcd242d73d" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a54b8e7bd6fc7ac3dcb1712bcd242d73d">rssiThreshold</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Minimal received RSSI necessary for adding source to routing table. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a129155f4064558e95b461cd5e222bf79"></a><!-- doxytag: member="WiseRoute::routeFloodsInterval" ref="a129155f4064558e95b461cd5e222bf79" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a129155f4064558e95b461cd5e222bf79">routeFloodsInterval</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Interval [seconds] between two route floods. A route flood is a simple flood from which other nodes can extract routing (next hop) information. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a033281ae1ebaa9bc4badf3a4e1a3a330"></a><!-- doxytag: member="WiseRoute::floodSeqNumber" ref="a033281ae1ebaa9bc4badf3a4e1a3a330" args="" -->
unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a033281ae1ebaa9bc4badf3a4e1a3a330">floodSeqNumber</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="a00094.html" title="A simple flooding protocol.">Flood</a> sequence number. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac53bb2f1e1c23bcb6c711e4dd991cd57"></a><!-- doxytag: member="WiseRoute::tracer" ref="ac53bb2f1e1c23bcb6c711e4dd991cd57" args="" -->
<a class="el" href="a00202.html">SimTracer</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>tracer</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6582d7c1cc2d4154a55aefff919d13ee"></a><!-- doxytag: member="WiseRoute::routeFloodTimer" ref="a6582d7c1cc2d4154a55aefff919d13ee" args="" -->
cMessage *&#160;</td><td class="memItemRight" valign="bottom"><b>routeFloodTimer</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4863c6c9c0b4648d1fe489f1e366ddfd"></a><!-- doxytag: member="WiseRoute::nbDataPacketsForwarded" ref="a4863c6c9c0b4648d1fe489f1e366ddfd" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbDataPacketsForwarded</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a93aec138fe8eb82509fa1e1123af11be"></a><!-- doxytag: member="WiseRoute::nbDataPacketsReceived" ref="a93aec138fe8eb82509fa1e1123af11be" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbDataPacketsReceived</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf7e7cc0f2bac73a975d0ba208364ec7"></a><!-- doxytag: member="WiseRoute::nbDataPacketsSent" ref="aaf7e7cc0f2bac73a975d0ba208364ec7" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbDataPacketsSent</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ade45073ec3c7fd876a3bdd7cc090e416"></a><!-- doxytag: member="WiseRoute::nbDuplicatedFloodsReceived" ref="ade45073ec3c7fd876a3bdd7cc090e416" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbDuplicatedFloodsReceived</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a55bd88188f20b6307c82d0b1f9af9766"></a><!-- doxytag: member="WiseRoute::nbFloodsSent" ref="a55bd88188f20b6307c82d0b1f9af9766" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbFloodsSent</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98dc1c65fd8aee95d2a9d4a5e63cec7b"></a><!-- doxytag: member="WiseRoute::nbPureUnicastSent" ref="a98dc1c65fd8aee95d2a9d4a5e63cec7b" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbPureUnicastSent</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afc9395ff804cb0c9bbfc15622688f664"></a><!-- doxytag: member="WiseRoute::nbRouteFloodsSent" ref="afc9395ff804cb0c9bbfc15622688f664" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbRouteFloodsSent</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf415e7572611a84f55a95adc5564435"></a><!-- doxytag: member="WiseRoute::nbRouteFloodsReceived" ref="aaf415e7572611a84f55a95adc5564435" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbRouteFloodsReceived</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0ac2253da16188710dad1b34ed3602d5"></a><!-- doxytag: member="WiseRoute::nbUnicastFloodForwarded" ref="a0ac2253da16188710dad1b34ed3602d5" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbUnicastFloodForwarded</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af70ef0701cd4d00762d10525481f8db6"></a><!-- doxytag: member="WiseRoute::nbPureUnicastForwarded" ref="af70ef0701cd4d00762d10525481f8db6" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbPureUnicastForwarded</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a75551cecd26f5133895afacd5f140e95"></a><!-- doxytag: member="WiseRoute::nbGetRouteFailures" ref="a75551cecd26f5133895afacd5f140e95" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbGetRouteFailures</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab0c5fcdca985cc551b56836f477e90ca"></a><!-- doxytag: member="WiseRoute::nbRoutesRecorded" ref="ab0c5fcdca985cc551b56836f477e90ca" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbRoutesRecorded</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2e56a303e52a2706bd60458071928669"></a><!-- doxytag: member="WiseRoute::nbHops" ref="a2e56a303e52a2706bd60458071928669" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><b>nbHops</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a219ae940d9facdca33297ec5d22ae32c"></a><!-- doxytag: member="WiseRoute::receivedRSSI" ref="a219ae940d9facdca33297ec5d22ae32c" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>receivedRSSI</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a31230cf7b9ecbdd2758ac6f9426c7adc"></a><!-- doxytag: member="WiseRoute::routeRSSI" ref="a31230cf7b9ecbdd2758ac6f9426c7adc" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>routeRSSI</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="accc36fd88e5b12c57907d36de0ffe84e"></a><!-- doxytag: member="WiseRoute::allReceivedRSSI" ref="accc36fd88e5b12c57907d36de0ffe84e" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>allReceivedRSSI</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af75a6dc3d381a12f671b7ed4d5f2f231"></a><!-- doxytag: member="WiseRoute::allReceivedBER" ref="af75a6dc3d381a12f671b7ed4d5f2f231" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>allReceivedBER</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a22c3d4ccded1b5f8df3e9f674955059b"></a><!-- doxytag: member="WiseRoute::routeBER" ref="a22c3d4ccded1b5f8df3e9f674955059b" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>routeBER</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae20ff5239162971bf39bc65e8d1b527d"></a><!-- doxytag: member="WiseRoute::receivedBER" ref="ae20ff5239162971bf39bc65e8d1b527d" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>receivedBER</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d93454b857556e70bf8a012621f2ec7"></a><!-- doxytag: member="WiseRoute::nextHopSelectionForSink" ref="a0d93454b857556e70bf8a012621f2ec7" args="" -->
cOutVector&#160;</td><td class="memItemRight" valign="bottom"><b>nextHopSelectionForSink</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a12bb6784eca1ad17663808bb8a45bb8d"></a><!-- doxytag: member="WiseRoute::trace" ref="a12bb6784eca1ad17663808bb8a45bb8d" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>trace</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a453b79d54a4dcd999485531e1b5b336a"></a><!-- doxytag: member="WiseRoute::stats" ref="a453b79d54a4dcd999485531e1b5b336a" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>stats</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa20b4f21d71d01e0a25ff690b3004f21"></a><!-- doxytag: member="WiseRoute::debug" ref="aa20b4f21d71d01e0a25ff690b3004f21" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#aa20b4f21d71d01e0a25ff690b3004f21">debug</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Debug switch for all other modules. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe926615dee528bddb5d5615f82dc85b"></a><!-- doxytag: member="WiseRoute::WiseRoute" ref="abe926615dee528bddb5d5615f82dc85b" args="(const WiseRoute &amp;)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#abe926615dee528bddb5d5615f82dc85b">WiseRoute</a> (const <a class="el" href="a00227.html">WiseRoute</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor is not allowed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a905cc9830c1aa94419ffbc20556dcd9a"></a><!-- doxytag: member="WiseRoute::operator=" ref="a905cc9830c1aa94419ffbc20556dcd9a" args="(const WiseRoute &amp;)" -->
<a class="el" href="a00227.html">WiseRoute</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00227.html#a905cc9830c1aa94419ffbc20556dcd9a">operator=</a> (const <a class="el" href="a00227.html">WiseRoute</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator is not allowed. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Wiseroute is a simple loop-free routing algorithm that builds a routing tree from a central network point. It is especially useful for wireless sensor networks and convergecast traffic, hence its name (Wireless Sensors Routing). The sink (the device at the center of the network) broadcasts a route building message. Each network node that receives it selects the sink as parent in the routing tree, and rebroadcasts the route building message. This procedure maximizes the probability that all network nodes can join the network, and avoids loops. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Jerome Rousselot </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a9c57e8afd945eeb5f5b2ca817ad7392d"></a><!-- doxytag: member="WiseRoute::updateRouteTable" ref="a9c57e8afd945eeb5f5b2ca817ad7392d" args="(const tRouteTable::key_type &amp;origin, const LAddress::L3Type &amp;lastHop, double rssi, double ber)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void WiseRoute::updateRouteTable </td>
          <td>(</td>
          <td class="paramtype">const tRouteTable::key_type &amp;&#160;</td>
          <td class="paramname"><em>origin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00117.html#ad85cd9e8d9e7e9cd5d02dd740c4a12a4">LAddress::L3Type</a> &amp;&#160;</td>
          <td class="paramname"><em>lastHop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>rssi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>ber</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Update routing table. </p>
<p>The tuple provided in argument gives the next hop address to the origin. The table is updated only if the RSSI value is above the threshold. </p>

<p>References <a class="el" href="a00117.html#a629f951ff7bc5f42e945bbc5573c4a0f">LAddress::L3NULL</a>, <a class="el" href="a00202.html#a6a0bdca61d51566cea8885d6b8ca17ec">SimTracer::logLink()</a>, <a class="el" href="a00028.html#a7df0d33fcf757b2e63af619f28bf3312">BaseNetwLayer::myNetwAddr</a>, and <a class="el" href="a00227.html#a54b8e7bd6fc7ac3dcb1712bcd242d73d">rssiThreshold</a>.</p>

<p>Referenced by <a class="el" href="a00227.html#a30099bfda16298ba45f76f4ba2fb0985">handleLowerMsg()</a>.</p>
<div class="fragment"><pre class="fragment">{
  tRouteTable::iterator pos;

  pos = routeTable.find(origin);
  <span class="keywordflow">if</span>(trace) {
    receivedRSSI.record(rssi);
    receivedBER.record(ber);
  }
  <span class="keywordflow">if</span> (pos == routeTable.end()) {
    <span class="comment">// A route towards origin does not exist yet. Insert the currently discovered one</span>
    <span class="comment">// only if the received RSSI is above the threshold.</span>
    <span class="keywordflow">if</span> (rssi &gt; <a class="code" href="a00227.html#a54b8e7bd6fc7ac3dcb1712bcd242d73d" title="Minimal received RSSI necessary for adding source to routing table.">rssiThreshold</a>) {
      tRouteTableEntry newEntry;

      <span class="comment">// last hop from origin means next hop towards origin.</span>
      newEntry.nextHop = lastHop;
      newEntry.rssi = rssi;
      <span class="keywordflow">if</span>(trace) {
        routeRSSI.record(rssi);
        routeBER.record(ber);
      }
      routeTable.insert(make_pair(origin, newEntry));
      <span class="keywordflow">if</span>(useSimTracer) {
        tracer-&gt;<a class="code" href="a00202.html#a6a0bdca61d51566cea8885d6b8ca17ec" title="Called by a routing protocol to log a link in a tree topology.">logLink</a>(<a class="code" href="a00028.html#a7df0d33fcf757b2e63af619f28bf3312" title="cached variable of my networ address">myNetwAddr</a>, lastHop);
      }
      nbRoutesRecorded++;
      <span class="keywordflow">if</span> (origin == <a class="code" href="a00117.html#a629f951ff7bc5f42e945bbc5573c4a0f" title="NULL address for L3 addresses.">LAddress::L3NULL</a> &amp;&amp; trace) {
        nextHopSelectionForSink.record(static_cast&lt;double&gt;(lastHop));
      }
    }
  }
  <span class="keywordflow">else</span> {
    <span class="comment">// A route towards the node which originated the received packet already exists.</span>
    <span class="comment">// Replace its entry only if the route proposal that we just received has a stronger</span>
    <span class="comment">// RSSI.</span>
<span class="comment">//    tRouteTableEntry entry = pos-&gt;second;</span>
<span class="comment">//    if (entry.rssi &gt; rssiThreshold) {</span>
<span class="comment">//      entry.nextHop = lastHop;</span>
<span class="comment">//      entry.rssi = rssi;</span>
<span class="comment">//      if (origin == 0)</span>
<span class="comment">//        nextHopSelectionForSink.record(lastHop);</span>
<span class="comment">//    }</span>
  }
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/netw/<a class="el" href="a00454_source.html">WiseRoute.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/netw/WiseRoute.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00227.html">WiseRoute</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:34 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
